package org.catlabs.CucumberSandbox;

import org.junit.Assert;

import cucumber.api.java.Before;
import cucumber.api.java.en.Given;

public class Validations {
	
	boolean pass;
	Validator validator;
	
	@Before
	public void before(){
		validator = new Validator();
	}

	@Given("^accept an account with 10 digits$")
	public void an_account_with_digits() throws Throwable {
		Assert.assertTrue(validator.validateAccountNumber("1234567890"));
	}

	@Given("^reject an account with less than 10 digits$")
	public void an_account_with_less_than_digits() throws Throwable {
		Assert.assertFalse(validator.validateAccountNumber("12345690"));
	}

	@Given("^reject an account with more than 10 digits$")
	public void an_account_with_more_than_digits() throws Throwable {
		Assert.assertFalse(validator.validateAccountNumber("123456901231231"));
	}

	@Given("^reject an account with non numeric characters$")
	public void an_account_with_non_numeric_characters() throws Throwable {
		Assert.assertFalse(validator.validateAccountNumber("12345a690"));
	}

	@Given("^accept a debit card number with 16 digits$")
	public void a_debit_card_number_with_digits() throws Throwable {
		Assert.assertTrue(validator.validateDebitCardNumber("1234567890123456"));
	}

	@Given("^reject a debit card number with less than 16 digits$")
	public void a_debit_card_number_with_less_than_digits()
			throws Throwable {
		Assert.assertFalse(validator.validateDebitCardNumber("12345678123456"));
	}

	@Given("^reject a debit card number with more than 16 digits$")
	public void a_debit_card_number_with_more_than_digits()
			throws Throwable {
		Assert.assertFalse(validator.validateDebitCardNumber("123456789012123456"));
	}

	@Given("^reject a debit card number with non numeric characters$")
	public void a_debit_card_number_with_non_numeric_characters()
			throws Throwable {
		Assert.assertFalse(validator.validateDebitCardNumber("12345w7890123456"));
	}

}
